﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MovieStorage;

namespace DVDFilmoteka.SaveloadManagement.ImportFilters
{
    class Import11
    {
        public static List<MovieDataStore> import(List<MovieDataStore> loaded)
        {
            List<MovieDataStore> returnList = new List<MovieDataStore>();

            foreach (var item in loaded)
            {
                if (item.quality.Equals("Podle média")) item.quality = "DVD-Video";

                MovieDataStore new_item = new MovieDataStore();

                new_item.compression = item.compression;
                new_item.container = item.container;
                new_item.csfdRating = item.csfdRating;
                new_item.czechName = item.czechName;
                new_item.fileName = item.fileName;
                new_item.channelCount = item.channelCount;
                new_item.imdbRating = item.imdbRating;
                new_item.language = item.language;
                new_item.link = item.link;
                new_item.mainGenre = item.mainGenre;
                new_item.medium = item.medium;
                new_item.mediumNotes = item.mediumNotes;
                new_item.movieNotes = item.movieNotes;
                new_item.myRating = item.myRating;
                new_item.originalName = item.originalName;
                new_item.otherGenre = item.otherGenre;
                try
                {
                    new_item.otherGenre.Add(Tools.GetGenreByName(item.mainGenre).ID);
                }
                catch { }
                new_item.quality = item.quality;
                new_item.resolution = item.resolution;
                new_item.size = item.size;
                new_item.timeOfAddtion = DateTime.Now;
                new_item.uniqueId = item.uniqueId;

                returnList.Add(new_item);
            }

            return returnList;
        }
    }
}
